package com.mp.approvalreq.dao;

import com.mp.approvalreq.entity.Outdoor;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * @author xq
 */
public interface OutdoorDao {

	/**
	 * 保存外出套件信息
	 *
	 * @param outdoor
	 * @throws SQLException
	 */
	void insertOutdoor(Outdoor outdoor) throws SQLException;

	/**
	 * 修改目的地信息
	 *
	 * @param destAddress
	 * @param destCoordinate
	 * @param requestId
	 * @throws SQLException
	 */
	void updateDestInfo(String destAddress, String destCoordinate, Integer requestId) throws SQLException;

	/**
	 * 作废外出套件信息
	 *
	 * @param requestId
	 * @param companyId
	 * @throws SQLException
	 */
	void deleteOutdoorByRequestId(Integer requestId, Integer companyId) throws SQLException;

	/**
	 * 作废外出套件信息
	 *
	 * @param outdoor
	 * @throws SQLException
	 */
	void deleteOutdoor(Outdoor outdoor) throws SQLException;

	/**
	 * 根据审批id获取最后一条外出套件详情记录
	 *
	 * @param requestId
	 * @return
	 * @throws SQLException
	 */
	Outdoor selectLastOutdoorByRequestId(Integer requestId) throws SQLException;

	/**
	 * 获取指定时间区间内存在外勤审批的公司id集合
	 *
	 * @param start
	 * @param end
	 * @return
	 * @throws SQLException
	 */
	List<Integer> selectExistOutdoorCompanyIdsByDateScope(String start, String end) throws SQLException;

	/**
	 * 查询全公司指定时间范围的外勤集合
	 *
	 * @param companyId
	 * @param startTime
	 * @param endTime
	 * @return
	 * @throws SQLException
	 */
	List<Outdoor> selectCompanyOutdoorsByDateScope(Integer companyId, String startTime, String endTime) throws SQLException;

	/**
	 * 批量查询用户指定时间范围的外勤集合
	 *
	 * @param companyId
	 * @param companyInfoIds
	 * @param startTime
	 * @param endTime
	 * @return
	 * @throws SQLException
	 */
	List<Outdoor> selectBatchUserOutdoorsByDateScope(Integer companyId, String companyInfoIds, String startTime, String endTime) throws SQLException;

	/**
	 * 根据id批量查询外勤集合
	 *
	 * @param requestIds
	 * @return
	 * @throws SQLException
	 */
	Map<Integer, Outdoor> selectOutdoorsByRequestIds(String requestIds) throws SQLException;
}
